package com.oocl.homework.format.data;

import java.util.ArrayList;
import java.util.List;

import com.oocl.homework.format.moel.Customer;

public class DataCustomerImpl implements DataCustomer{
	
	private static List<Customer> customers;
	
	
private static DataCustomerImpl customerDaoImpl;
	
	
	
	public static DataCustomerImpl getInstance(){
		if(customerDaoImpl==null){
			synchronized (DataCustomerImpl.class) {
				if (customerDaoImpl==null) {
					customerDaoImpl = new DataCustomerImpl();
				}
			}
		}
		return customerDaoImpl;
	}
	
	private DataCustomerImpl() {
		customers = new ArrayList<>();
	}
	
	

	@Override
	public void add(Customer customer) {
		customers.add(customer);
		
	}
	
	public List<Customer> getCustomers(){
		return customers;
	}
	
}
